<template>
  <header>
    <el-col  class="left">
        <div class="flex-box-align" style="height: 100%;padding: 0 10px;" @click="$router.push('/')">
            <span style="line-height: normal;">万和制药管理系统</span>
        </div>
    </el-col>
    <el-col :span="18">hi，欢迎登录万和制药管理系统</el-col>
    <el-dropdown @command="handleCommand">
            <span class="el-dropdown-link">
                <p class="manager">
                    <img alt="Avatar" src="../../images/avatar.png" class="down" />
                </p>
                <p>{{userInfo.userName}}</p>
            </span>
      <el-dropdown-menu slot="dropdown">
        <!--<el-dropdown-item command="0">重置密码</el-dropdown-item>-->
        <el-dropdown-item command="1">退出登录</el-dropdown-item>
      </el-dropdown-menu>
    </el-dropdown>
  </header>
</template>

<script>
  export default {
    data () {
      return {
        menuShow:false,
        manager:'',
        userInfo: {}
      }
    },
    created(){
        this.userInfo = JSON.parse(sessionStorage.getItem('userInfo'))
    },
    mounted(){
    },
    methods:{
      handleCommand(command) {
        if(command == '1'){
          this.$router.push("/loginPage");
        }else{
          this.$router.push("/rechargePassword");
        }
      }
    }
  }
</script>

<style lang="scss" scoped>
  header{
    position: fixed;
    display: flex;
    -webkit-display: flex;
    align-items: center;
    -webkit-align-items: center;
    height: 80px;
    background-color: #fff;
    color: #1989fa;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999;
    font-size: 16px;
    font-weight: 700;
    // position: relative;
    .manager{
      position: relative;
      /*padding-right: 30px;*/
      img{
        /*position: absolute;*/
        width: 50px;
      height: 50px;
        right: 0;
        top:2px;
      }
      .down{
        border-radius: 50%;
        top:5px;
      }
    }
    .left{ width: 205px;background-color:#1989fa;color: #fff;height: 80px;line-height: 80px;text-align: center;font-size: 16px;
      position: absolute;left: 0;top:0;}
    .el-col-18 {padding-left: 255px;}
  }
  .el-dropdown{
    margin-left: 10%;
  }
  .el-dropdown-link{
    /*display: flex;*/
    /*-webkit-display: flex;*/
    /*align-items: center;*/
    /*-webkit-align-items: center;*/
    cursor: pointer;
    span{
      color: #1989fa;
    }
    p{
      color: #000;
        text-align: center;
    }

    img{
      position: relative;
      /*margin-right: 10px;*/
      width: 35px;
      height: 35px;
      border-radius: 50%;
      -webkit-border-radius: 50%;
    }
  }
</style>
